<%--
	This page logs in a user into the IW demo version site, bypassing
	the login verification. This page is developed so that it can be
	passed as an email link and the user can get logged in with a single click.
--%>
<%@page import="merlin.beans.*,merlin.managers.*,merlin.utils.*" %>

<%
	ApplicationResources resource = ApplicationResources.getInstance();
	int sessionTimeoutDuration = Integer.parseInt(resource.getProperty("iwSessionTimeoutDuration"));

	// A dummy IW bean, just to push it into the session.
	IWCustomerDetailsBean bean = IndustryWatchManager.loginForIndustryWatch("trial@merlinscottassociates.co.uk","password");
	bean.setPdfCredits(3);	// three credits always available
	bean.setLicenceAcceptanceDate(new java.util.Date());

	session.setAttribute("IWusername","trial@merlinscottassociates.co.uk");
	session.setAttribute("IWUserDetails",bean);
	// session validity .
	session.setMaxInactiveInterval(sessionTimeoutDuration*60);

%>

<jsp:forward page="iwMainPageDemoVersion.jsp"/>